package com.silver.weibo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.silver.weibo.utils.MyContents;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Comments implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer blogId;
    private Integer userId;
    private String content;
    private Date createTime;
    @TableLogic
    private Integer deleted;

    public String getCreateTime() {
        return MyContents.simpleDateFormat.format(this.createTime);
    }
}
